<?php
defined('_JEXEC') or die;

jimport('joomla.application.component.controlleradmin');


class CouponsControllerShops extends JControllerAdmin
{
    private $link = "index.php?option=com_coupons&view=shops";
    
    public function getModel($name = 'Shop', $prefix = 'CouponsModel', $config = array('ignore_request' => true))
    {
            $model = parent::getModel($name, $prefix, $config);
            return $model;
    }
    
    public function remove()
    { 
        $model = $this->getModel('Shops');
        $deleteResult = $model->delete();
        if(!$deleteResult)
        {
            JError::raiseWarning(null, JText::_("COM_COUPONS_DELETING_ERROR"));
            $this->setRedirect(JRoute::_($this->link));
        }
        else
            $this->setRedirect(JRoute::_($this->link), JText::_("COM_COUPONS_DELETED"));
    }
}
?>